package com.sumainfor.pc.epc.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.epc.service.impl.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/3/6 19:21
 * @Description:
 */
@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    ArticleService ArticleService;

    /**
     * 功能描述: 
     * 获取物品清单分类
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/3/6 19:25
     */
    @GetMapping("/getArticleTypeList")
    public JsonResult getArticleTypeList(){
        JsonResult result=new JsonResult();
        Map<String,Object> params=new HashMap<String,Object>();
        params.put("delfg",0);
        List<Map<String,Object>> getArticleTypeList=ArticleService.getArticleTypeList(params);
        result.put(getArticleTypeList);
        return result;
    }

    /**
     * 功能描述: 
     * 根据物品分类获取物品
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/3/6 19:27
     */
    @GetMapping("/getArticleList")
    public JsonResult getArticleList(@RequestParam Map<String,Object>params){
        JsonResult result=new JsonResult();
        params.put("delfg",0);
        List<Map<String,Object>>getArticleList=ArticleService.getArticleList(params);
        result.put(getArticleList);
        return result;
    }

    /**
     * 功能描述:
     * 根据物品获取物品故障描述
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/3/6 19:27
     */
    @GetMapping("/getArticleTroubleList")
    public JsonResult getArticleTroubleList(@RequestParam Map<String,Object>params){
        JsonResult result=new JsonResult();
        params.put("delfg",0);
        List<Map<String,Object>>getArticleTroubleList=ArticleService.getArticleTroubleList(params);
        result.put(getArticleTroubleList);
        return result;
    }

}
